package com.yurui.anno;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;

@Component
@PropertySource(value = "classpath:config.properties",encoding = "UTF-8")
@Scope(value = "refresh",proxyMode = ScopedProxyMode.TARGET_CLASS)
public class ComponentBean {


    @Value(value = "${user.country}")
    private String name;

    @Value(value = "${author.name}")
    private String authorName;

    public void say(){
        System.out.println("name="+name);
        System.out.println("authorName="+authorName);
    }
}
